package utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPool {
    private final ExecutorService executor = Executors.newFixedThreadPool(20);

    private ThreadPool() {
    }

    private static class HOLDER {
        private static final ThreadPool INSTANCE = new ThreadPool();
    }

    private static ThreadPool getInstance() {
        return HOLDER.INSTANCE;
    }

    public static void work(Runnable action) {
        getInstance().executor.submit(action);
    }
}
